#include "newwindsend.h"
#include "ui_newwindsend.h"

NewWindSend::NewWindSend(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::NewWindSend)
{
    ui->setupUi(this);

    ui->line_send->setReadOnly(true);
    ui->line_send->setAlignment(Qt::AlignHCenter);
    setVisible(false);
}

NewWindSend::~NewWindSend()
{
    delete ui;
}
void NewWindSend::SetVisible(bool flag){
    ui->text_send->setVisible(flag);
    ui->btn_send->setVisible(flag);
}
// return data to main wnd
void NewWindSend::on_btn_send_clicked()
{
    QString datastr = ui->text_send->toPlainText().trimmed();
    emit SendMainWndData(datastr);
}

void NewWindSend::SetWrtState(bool wrtState){
    ui->line_send->setText(wrtState ? "成功" : "失败");
}
